home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1998 April
/
EnigmA AMIGA RUN 26 (1998)(G.R. Edizioni)(IT)[!][issue 1998-04].iso
/
earkit
/
browser
/
alynx
/
goodies
/
mail.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1998-03-13
|
3KB
|
89 lines
/*) SimpleSendMail v1.0 by Josef Faulkner (panther@gate.net) IRC: Josef
\\\
/// Custom version written for Alynx
\\\
/// Installation: Simple 1,2,3
\\\
/// 1) Install TCP: by mounting TCP: (mlink) or just run AmiTCP
\\\ 2) Set your SMTP hostname below (your server's hostname)
/// 3) Copy this script to C: and protect c:mail +S
\\\
/// This arexx script will not workw ith As225. If you are using mlink,
\\\ then mount tcp: from amitcp:devs/inet-mountlist. If you need the
/// mountlist entry and handler, mail me and I will send it to you uuencoded.
\\\
(*/
SMTPHost = 'cyber.gate.net' /* Your ISP's mail server, or leave as
cyber.gate.net as I know it works. */
/*) How it works:
\\\ Sending mail is no problem for SLIP, however the problem with most mail
/// clients is the reading. This solves the problem for those of us who dont
\\\ need to read mail while on SLIP, and only want to send it.
///
\\\ This program connects to port 25 (SMTP) of your unix host, tells it
/// who you are, and who you want your mail to go to, then it sends the message
\\\ data and quits. Pretty simple, eh?
///
\\\ If you have any questions, comments, or whatever, mail me (panther@gate.net)
///
\\\ Disclaimer:
/// This program is public domain, use at your own risk, if something goes
\\\ wrong, feel free to drop me a message or if you have any questions.
/// However, if you dont like this program, then dont use it, you didnt pay
\\\ anything for it, so dont flame me because it doesnt work on your system...
(*/
options results
if ~show('L','rexxsupport.library') then if ~addlib('rexxsupport.library',0,-30,0) then do
'echo You need rexxsupport.library version 30 or greater in libs:'
exit 10
end
parse arg file
file=strip(file)
if ~showlist(H,'TCP') then address command 'mount TCP: from amitcp:devs/inet-mountlist'
if ~showlist(H,'TCP') then address command 'mount TCP:'
if showlist(H,'TCP') then do
if file~='' then do
call open(1,file,r)
do until eof(1)
text=readln(1)
if word(text,1)='Subject:' then do
parse var text .' 'subj
subj=strip(subj)
end
if word(text,1)='To:' then do
userid=strip(word(text,2))
end
if word(text,1)='From:' then do
myemailaddr=strip(word(text,2))
end
end
call close(1)
if showlist('A','HOME') then do
if exists('HOME:.signature') then do
address command 'type home:.signature >>'file
end
end
call open(1,'tcp:'smtphost'/25',w)
call writeln(1,'HELO')
call writeln(1,'MAIL FROM: '||myemailaddr)
call writeln(1,'RCPT TO: '||userid)
call writeln(1,'DATA')
call open(2,file,r)
do until eof(2)
text=readln(2)
call writeln(1,text)
end
call close(2)
call writeln(1,'.')
call writeln(1,'QUIT')
call close(1)
address command 'Requestchoice title="Simple MailSend" BODY="Mail Sent." GADGETS="Ok" >NIL:'
end
else address command 'Requestchoice title="Simple MailSend" BODY="Mail Send Aborted." GADGETS="Ok" >NIL:'
end
else address command 'Requestchoice title="Simple MailSend" BODY="Error:*eCould not find temp file." GADGETS="Ok" >NIL:'
exit